<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>

<rich:panel header="#{messages['member.account.transaction']}">
	<h:panelGrid ><h:outputText value="#{errorBean.errorMessage}" styleClass="error"></h:outputText></h:panelGrid>
    
    <h:panelGrid rendered="#{adminMemberAgreementPointEnquiryBean.userAccountSuspended}" columns="1">
			<h:outputText value="#{messages['user.suspended.msg']}" styleClass="error"/>
    </h:panelGrid>	

	<t:panelGrid columns="2">
		<h:outputLabel value="#{messages['member.name.label']}" styleClass="standardText_Label" />
		<h:outputText value="#{adminMemberAgreementPointEnquiryBean.member.name}" styleClass="standardText" />
		
		<h:outputLabel value="#{messages['member.type']}" styleClass="standardText_Label" />
		<h:outputText value="#{adminMemberAgreementPointEnquiryBean.member.memberTypeLabel}" styleClass="standardText" />

		<h:outputText value="#{messages['agreement.no']}" styleClass="standardText_Label" />
		<h:outputText value="#{adminMemberAgreementPointEnquiryBean.agreement.agreetmentNo}" styleClass="standardText" />
		
		<h:outputText value="#{messages['membership']}" styleClass="standardText_Label" />
		<h:outputText value="#{adminMemberAgreementPointEnquiryBean.agreement.membership.name}" styleClass="standardText" />

		<h:outputLabel value="#{messages['membership.no.label']}" styleClass="standardText_Label" />
		<h:outputText value="#{adminMemberAgreementPointEnquiryBean.member.membershipNo}"styleClass="standardText" />
		
	</t:panelGrid>
	
	<h:commandButton value="Advance Entitlement" styleClass="button" rendered="#{adminMemberAgreementPointEnquiryBean.agreement.advancedYear==0}"
	 action="#{adminMemberAgreementPointEnquiryBean.advanceAction}" immediate="true"></h:commandButton>
	<h:commandButton value="Advance In Progress..." disabled="true" readonly="true" styleClass="button" rendered="#{adminMemberAgreementPointEnquiryBean.agreement.advancedYear!=0}"></h:commandButton>
	
	<rich:spacer height="10" />
	
	<rich:dataTable id="data" var="point" value="#{adminMemberAgreementPointEnquiryBean.pointList}" rows="20" width="99%" >
		<rich:column style="text-align:center;width:25%;" >
			<f:facet name="header">
				<h:outputText value="#{messages['point.category']}"></h:outputText>
			</f:facet>
			<h:outputText value="#{point.pointCategory.name}"></h:outputText>
		</rich:column>
		<rich:column style="text-align:center;width:25%;">
			<f:facet name="header">
				<h:outputText value="#{messages['point.entitle.year']}"></h:outputText>
			</f:facet>
			<h:outputText value="#{point.yearInt}"></h:outputText>
		</rich:column>
		<rich:column style="text-align:center;width:25%;">
			<f:facet name="header">
				<h:outputText value="#{messages['status']}"></h:outputText>
			</f:facet>
			<h:outputText value="#{point.statusLabel}"></h:outputText>
		</rich:column>
		<rich:column style="text-align:center;width:25%;">
			<f:facet name="header">
				<h:outputText value="#{messages['point.remain']}"></h:outputText>
			</f:facet>
			<h:outputText value="#{point.pointInt}"></h:outputText>
		</rich:column>
		<rich:column style="text-align:center;width:25%;">
			<f:facet name="header">
				<h:outputText value="#{messages['expiry.date.column']}"></h:outputText>
			</f:facet>
			<h:outputText value="#{point.expiryDate}">
				<f:convertDateTime pattern="dd/MM/yyyy" timeZone="Asia/Kuala_Lumpur"/>
			</h:outputText>
		</rich:column>
		<rich:column style="text-align:center;width:25%;"  rendered="#{adminMemberAgreementPointEnquiryBean.showAdjustment}">
			<f:facet name="header">
				<h:outputText value="Adjustment"></h:outputText>
			</f:facet>
	 
			<t:inputText size="5" maxlength="5"   styleClass="standardText" value="#{point.adjustTo}" />

			<h:commandButton value="+" styleClass="button" actionListener="#{adminMemberAgreementPointEnquiryBean.adjustAddAction}"  ></h:commandButton>		
			<h:commandButton value="-" styleClass="button" actionListener="#{adminMemberAgreementPointEnquiryBean.adjustMinusAction}"  ></h:commandButton>
		
			<f:param value="#{point.memberPointEntitleId}" id="selectedMemberPointEntitlement"/>
			
		</rich:column>
		<rich:column style="text-align:center;width:25%;"  rendered="#{adminMemberAgreementPointEnquiryBean.showAccrued}" >
			<f:facet name="header">a
				<h:outputText value="Accrued"></h:outputText>
			</f:facet>
	 
			<t:inputCalendar
				monthYearRowClass="yearMonthHeader" weekRowClass="weekHeader" 
				currentDayCellClass="currentDayCell" value="#{point.accruedDate}"
				renderAsPopup="true" popupTodayString="#{messages['popup.today']}"
				popupWeekString="#{messages['popup.week']}" popupDateFormat="dd/MM/yyyy"
				renderPopupButtonAsImage="true"
				styleClass="standardText" required="false" rendered="#{point.expiredDateBeforeAccrued == null}">
	    	</t:inputCalendar>
	    	<h:commandButton value="+" styleClass="button" actionListener="#{adminMemberAgreementPointEnquiryBean.accruedAction}"  
	    	 rendered="#{point.expiredDateBeforeAccrued == null}"></h:commandButton>
		
			<f:param value="#{point.memberPointEntitleId}" id="selectedMemberPointEntitlement2"/>
			
		</rich:column>
	</rich:dataTable>
	
	<rich:spacer height="10"></rich:spacer>
	
	<h:commandButton value="Adjustment" styleClass="button" actionListener="#{adminMemberAgreementPointEnquiryBean.adjustmentShowAction}" immediate="true"></h:commandButton>
	<rich:spacer width="10"></rich:spacer>
	
	<h:commandButton value="Accrued" styleClass="button" actionListener="#{adminMemberAgreementPointEnquiryBean.accruedShowAction}" immediate="true"></h:commandButton>
	
	<rich:datascroller align="left"  for="data" maxPages="20" renderIfSinglePage="false" />

	<rich:spacer height="10" />

    
	<h:panelGrid columns="1" width="99%">

		<rich:tabPanel selectedTab="#{adminMemberAgreementPointEnquiryBean.currentTabStatus}"  >

			<rich:tab name="#{adminMemberAgreementPointEnquiryBean.tabTransStatus}" label="#{messages['transaction.history']}" immediate="true" switchType="server"  actionListener="#{adminMemberAgreementPointEnquiryBean.tabTransListener}" >

				
 
				<tiles:insert flush="false" page="/secure/modules/timeshareservice/member/member.transaction.history.jsp" />


			</rich:tab>

			<rich:tab name="#{adminMemberAgreementPointEnquiryBean.tabInvoiceStatus}" label="#{messages['invoice.history']}" immediate="true" switchType="server" actionListener="#{adminMemberAgreementPointEnquiryBean.tabInvoiceListener}" >



				<tiles:insert flush="false" page="/secure/modules/timeshareservice/member/member.invoice.history.jsp" />


			</rich:tab>
			<rich:tab name="#{adminMemberAgreementPointEnquiryBean.tabMicStatus}" label="Others" immediate="true" switchType="server" actionListener="#{adminMemberAgreementPointEnquiryBean.tabMicListener}" >



				<tiles:insert flush="false" page="/secure/modules/timeshareservice/member/member.mic.jsp" />


			</rich:tab>
		</rich:tabPanel>

    </h:panelGrid>





	<rich:spacer height="30" />
	<t:panelGrid columns="1">
		<h:commandButton value="#{messages['back']}" styleClass="button" action="#{adminMemberAgreementMgmtBean.backToList}" immediate="true"></h:commandButton>
	</t:panelGrid>
 	
</rich:panel>
